Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: lazy loading history #301

Merged
merged 5 commits into from
Oct 28, 2015
Merged

feat: lazy loading history #301

merged 5 commits into from
Oct 28, 2015

Conversation

dimaip
Copy link
Contributor

@dimaip dimaip commented Oct 27, 2015

This feature simplifies the state of an app a lot: messages are removed from initial state and are lazily loaded my Messages component itself.
History loads in packs of 20 messages, based on the baseDate. Loading status for each channel is stored in the local channels state, next to lastSeen.

Resolves: #278 #302

this.props.currentChannel.get('loadingStatus') !== 'LOADING'
) {
// Prevent scroll jump
this.state.skipNextScroll = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use method setState for mutating state.
But It would be class variable in this case (this. skipNextScroll)

We load history in packs of 20 messages (sorry, this value if hardcoded
for now due to lack of centrlized settings storage).
Messages are counted in reverse order from baseDate.
This feature could get a little more polish like a loading indicator or
more smooth scroll, but well, day has only 24 hours...
SeqviriouM added a commit that referenced this pull request Oct 28, 2015
@SeqviriouM SeqviriouM merged commit 71b646a into master Oct 28, 2015
@SeqviriouM SeqviriouM deleted the load_history branch October 28, 2015 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants